<?php
/**
 * Created by PhpStorm.
 * User: white
 * Date: 2020/4/4
 * Time: 0:14
 */

namespace app\common\validate;

use think\Validate;

class Cate extends Validate
{
    protected $rule = [
        'catename|栏目名称' => 'require|unique:cate',
        'sort|栏目排序编号' => 'require|number'
    ];

    //栏目添加场景验证
    public function sceneCateadd()
    {
        return $this -> only(['catename','sort']);
    }

    //栏目排序场景
    public function sceneCatesort(){
        return $this -> only(['sort']);
    }

    //栏目名称编辑场景
    public function sceneCateedit()
    {
        return $this -> only(['catename']);
    }

}